package com.game.centerserver.infrastructure.service.impl;

import com.game.centerserver.infrastructure.entity.DstServerIni;
import com.game.centerserver.infrastructure.dao.DstServerIniDao;
import com.game.centerserver.infrastructure.service.DstServerIniService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * (DstServerIni)表服务实现类
 *
 * @author makejava
 * @since 2024-11-10 17:17:12
 */
@Service("dstServerIniService")
public class DstServerIniServiceImpl implements DstServerIniService {
    @Resource
    private DstServerIniDao dstServerIniDao;

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    @Override
    public DstServerIni queryById(Integer id) {
        return this.dstServerIniDao.queryById(id);
    }

    @Override
    public List<DstServerIni> queryByArchiveId(String archiveId) {
        return dstServerIniDao.queryByArchiveId(archiveId);
    }

    /**
     * 新增数据
     *
     * @param dstServerIni 实例对象
     * @return 实例对象
     */
    @Override
    public boolean insert(DstServerIni dstServerIni) {
        return this.dstServerIniDao.insert(dstServerIni) > 0;
    }

    /**
     * 修改数据
     *
     * @param dstServerIni 实例对象
     * @return 实例对象
     */
    @Override
    public boolean update(DstServerIni dstServerIni) {
        return this.dstServerIniDao.update(dstServerIni) > 0;
    }

    /**
     * 通过主键删除数据
     *
     * @param id 主键
     * @return 是否成功
     */
    @Override
    public boolean deleteById(String id) {
        return this.dstServerIniDao.deleteById(id) > 0;
    }

    @Override
    public boolean deleteArchiveId(String archiveId) {
        return dstServerIniDao.deleteByArchiveId(archiveId) > 0;
    }

    // TODO
    @Override
    public DstServerIni queryByArchiveIdAndIsMaster(String archiveId, Integer isMaster) {
        return null;
    }
}
